home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE23 / PASTOWEB / PrjToWeb.pas < prev    next >
Pascal/Delphi Source File  |  1997-05-20  |  2KB  |  105 lines

  1. unit PrjToWeb;
  2.  
  3. interface
  4.  
  5. uses
  6.   ExptIntf, Windows;
  7.  
  8. type
  9.   TPrjToWebWizard = class (TIExpert)
  10.   public
  11.     function GetStyle: TExpertStyle; override;
  12.     function GetName: string; override;
  13.     function GetAuthor: string; override;
  14.     function GetComment: string; override;
  15.     function GetPage: string; override;
  16.     function GetGlyph: HICON; override;
  17.     function GetState: TExpertState; override;
  18.     function GetIDString: string; override;
  19.     function GetMenuText: string; override;
  20.     procedure Execute; override;
  21.   end;
  22.  
  23. procedure Register;
  24.  
  25. implementation
  26.  
  27. uses
  28.   Dialogs, ToolIntf, SysUtils, Convert, ShellApi;
  29.  
  30. function TPrjToWebWizard.GetStyle: TExpertStyle;
  31. begin
  32.   // show up in the Help menu
  33.   Result := esStandard;
  34. end;
  35.  
  36. function TPrjToWebWizard.GetName: String;
  37. begin
  38.   // official name
  39.   Result := 'PrjToWeb Wizard'
  40. end;
  41.  
  42. function TPrjToWebWizard.GetAuthor: string;
  43. begin
  44.   Result := 'Marco Cant∙';
  45. end;
  46.  
  47. function TPrjToWebWizard.GetComment: String;
  48. begin
  49.   Result := 'PrjToWeb Wizard';
  50. end;
  51.  
  52. function TPrjToWebWizard.GetPage: string;
  53. begin
  54.   Result := '';
  55. end;
  56.  
  57. function TPrjToWebWizard.GetGlyph: HICON;
  58. begin
  59.   Result := 0;
  60. end;
  61.  
  62. function TPrjToWebWizard.GetState: TExpertState;
  63. begin
  64.   if ToolServices.GetProjectName <> '' then
  65.     Result := [esEnabled]
  66.   else
  67.     Result := [];
  68. end;
  69.  
  70. function TPrjToWebWizard.GetIDString: String;
  71. begin
  72.   // must be unique
  73.   Result := 'MarcoCantu.PrjToWebWizard'
  74. end;
  75.  
  76. function TPrjToWebWizard.GetMenuText: String;
  77. begin
  78.   // the text of the menu item
  79.   Result := '&PrjToWeb Wizard...'
  80. end;
  81.  
  82. procedure TPrjToWebWizard.Execute;
  83. var
  84.   Copyr, ResFile: string;
  85. begin
  86.   Copyr := 'Source code copyright ...';
  87.   if InputQuery ('PrjToWeb Wizard',
  88.     'Enter Copyright notice:', Copyr) then
  89.   begin
  90.     ResFile := CurrProjectToHTML (Copyr);
  91.     if MessageDlg ('HTML file generated.'#13 +
  92.         'Do you want to open it in your browser?',
  93.         mtConfirmation, [mbYes, mbNo], 0) = idYes then
  94.       ShellExecute (ToolServices.GetParentHandle,
  95.         'open', PChar (ResFile), '', '', sw_ShowNormal);
  96.   end;      
  97. end;
  98.  
  99. procedure Register;
  100. begin
  101.   RegisterLibraryExpert(TPrjToWebWizard.Create);
  102. end;
  103.  
  104. end.
  105.